﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace SpriteEditor
{
    public class Animation : SpriteCalculation
    {
        public int Index { get; set; }
        public int ID { get; set; }
        public string Desc { get; set; }

        public int NumOfFrames { get; set; }
        public List<FramesOfAnimation> lst_FramesOfAnimation { get; set; }

        public Animation()
        {
            NumOfFrames = 0;
            lst_FramesOfAnimation = new List<FramesOfAnimation>();
        }

        public Animation clone()
        {
            Animation a = new Animation();
            a.ID = ID;
            a.Index = Index;
            a.NumOfFrames = NumOfFrames;
            a.Desc = Desc;
            for (int i = 0; i < lst_FramesOfAnimation.Count; i++)
            {
                FramesOfAnimation f = lst_FramesOfAnimation[i].clone();
                a.lst_FramesOfAnimation.Add(f);
            }
            return a;
        }
    }

    public class FramesOfAnimation : SpriteCalculation
    {
        public int Index { get; set; }
        public int ID { get; set; }
        public int OX { get; set; }
        public int OY { get; set; }
        public int Time { get; set; }

        public FramesOfAnimation clone()
        {
            FramesOfAnimation f = new FramesOfAnimation();
            f.Index = Index;
            f.ID = ID;
            f.OX = OX;
            f.OY = OY;
            f.Time = Time;
            return f;

        }
        public Frame getFramFromId()
        {
            return frmMain.spr.getFrameFromID(ID);
        }
    }
}
